'''
@Project ：python-study
@File    ：8.11练习：生成电影排行榜.py
@IDE     ：PyCharm
@Author  ：SUNLIN
@Date    ：2025/3/12 11:23:15
'''
import pandas as pd
import numpy as np

pd.set_option('display.expand_frame_repr', False)
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 100)

data = pd.read_excel('../doc/datasource/C8-8.5-数据采集-clean.xlsx',
                     usecols=['movie_name', 'country', 'language', 'release_date', 'average_score', 'number_of_people'])
# 按照所定义顺序排序
data = data[['movie_name', 'average_score', 'number_of_people']]

data_sorted = data.sort_values(by=['average_score', 'number_of_people'], ascending=False)

# 提取出前10位的数据
print(data_sorted[0:30])
